<template>
	<!-- 项目 -->
	<view class="upload">
		<uniTabs :tabs="tabs" :activeTab="activeTab" lineHeight="false" @change="change" activeColor="#DD524D"
			class="tabs"></uniTabs>
			<view class="info-content">
				<view v-if='activeTab==0' class="info-active">
				<div class="info-item">
					<p class="item-left">企业名称：</p>
					<p class="item-right">{{teamList.name||'暂无'}}</p>
				</div>
				
				<div class="info-item">
					<p class="item-left">社会统一信用编码：</p>
					<p class="item-right">{{teamList.code||'暂无'}}</p>
				</div>
				<div class="info-item">
					<p class="item-left">法定代表人：</p>
					<p class="item-right">{{teamList.legal_person}}</p>
				</div>
				<div class="info-item">
					<p class="item-left">成立日期：</p>
					<p class="item-right">{{teamList.date||'暂无'}}</p>
				</div>
				<div class="info-item">
					<p class="item-left">企业类型：</p>
					<p class="item-right">{{teamList.type}}</p>
				</div>
				<div class="info-item">
					<p class="item-left">注册资金：</p>
					<p class="item-right">{{teamList.registered_capital||'暂无'}}</p>
				</div>
				<div class="info-item">
					<p class="item-left">注册地址：</p>
					<p class="item-right">{{teamList.registered_address||'暂无'}}</p>
				</div>
				<div class="info-item">
					<p class="item-left">办公地址：</p>
					<p class="item-right">{{teamList.office_address||'暂无'}}</p>
				</div>
				<div class="info-item">
					<p class="item-left">企业LOGO：</p>
					<p class="item-img"><image :src="teamList.logo" mode=""></image></p>
				</div>
				<div class="info-item">
					<p class="item-left">企业营业执照：</p>
					<p class="item-img"><image :src="teamList.business" mode=""></p>
				</div>
				<div class="info-item">
					<p class="item-left">经营范围：</p>
				</div>
				<div class="info-item">{{teamList.business_scope||'暂无'}}</p>
				</div>
				<div class="info-item">
					<p class="item-left">企业联系人：</p>
					<p class="item-right">{{teamList.contact||'暂无'}}</p>
				</div>
				<div class="info-item">
					<p class="item-left">联系人电话：</p>
					<p class="item-right">{{peopleDetail.mobile||'暂无'}}</p>
				</div>
				<div class="info-item">
					<p class="item-left">联系人邮箱：</p>
					<p class="item-right">{{peopleDetail.email||'暂无'}}</p>
				</div>
				<div v-if="personInfo.account_type=='工程企业'">
					<div class="info-item" >
						<p class="item-left">业务范围：</p>
						<text v-for="(item,index) in businessScope">{{item.name +','}}</text>
						<text v-if="businessScope.length<1">暂无</text>
					</div>
					<div class="info-item">
						<p class="item-left">服务范围：</p>
						<text  v-for="(item,index) in serviceScope">{{item.name +','}}</text>
						<text v-if="serviceScope.length<1">暂无</text>
					</div>
					<div class="info-item">
						<p class="item-left">工人数量：</p>
						<p class="item-right">{{teamList.worker||'暂无'}}</p>
					</div>
				</div>
				</view>
				<view v-if='activeTab==1' class="info-active">
					<view v-for="(item,index) in teamList.quali_list" class="honor-item">
						<div  class="honor-left">
							<image class="honor-image" src="../../../static/image/mine/honor.png" mode=""></image>
							<p class="honor-left-title">{{item.name}}</p>
							<p class="honor-left-place">{{item.construction_unit}}</p>
							<p class="honor-left-time">{{item.engineering_cycle}}</p>
						</div>
						<div class="honor-right"><image :src="item.image" mode=""></image></div>
					</view>
				</view>
				<view v-if='activeTab==2' class="info-project">
					<view class="honor-item" v-for="(item,index) in teamList.project_list">
							<image class="honor-image" src="../../../static/image/mine/parentProject.png" mode=""></image>
							<p class="honor-left-title">{{item.name}}</p>
							<p class="honor-left-place">{{item.construction_unit}}</p>
							<p class="honor-left-time">{{item.engineering_cycle}}</p>
					</view>
				</view>
				
			</view>
			
	</view>
</template>

<script>
	import uniTabs from '@/components/v-tabs/v-tabs.vue'
	import api from '@/static/js/api.js'
	export default {
		components: {
			uniTabs
		},

		data() {
			return {
				tabs: [
					'基础信息',
					'荣誉资质',
					'既往项目'
				],
				activeTab: 0,
				userinfo:'',
				teamList:{},
				businessScope:[],
				serviceScope:[]
			}
		},
       onShow() {
       	 this.userinfo = JSON.parse(uni.getStorageSync('userInfo'));
       	 this.classList()
       },
		methods: {
			change(index) {
				this.activeTab = index
			},
			classList(){
			  // this.userinfo.location_company_id = 2
				api.laborClass('jhj.company','_api_public_one_company',this.userinfo.location_company_id).then(res=>{
							  this.teamList = res.data[0]
							  console.log(this.teamList)
							  this.businessScope = res.data[0].business_ids
							  this.serviceScope = res.data[0].city_ids
				 }).catch(e => {
					uni.showToast({
						icon: 'none',
						title: e.message
					})
				})
			}
		}

	}
</script>

<style lang="less" scoped>
	.upload {
		width: 100%;
		// height: 100vh;
		background-color: #EBEEF5;
	}

	.tabs {
		position: relative;
	}

	/deep/ .v-tabs {
		width: 100%;
		height: 100rpx;
		background-color: #FFFFFF;
		line-height: 100rpx;
	}

	/deep/ .v-tabs__container-item {
		width: 50%;
		justify-content: center;
	}

	.info-content{
		margin-top: 12rpx;
		background-color: #FFFFFF;
		.info-item{
			width: 94%;
			// height: 50rpx;
			padding: 15rpx 0;
			// line-height: 50rpx;
			margin: 0 auto;
			display: flex;
			justify-content: space-between;
		}
		.item-left{
			color: #666;
		}
		.item-img{
			width: 150rpx;
			height: 150rpx;
			// border: 1px solid #999999;
			margin-right: 50rpx;
			margin-top: 20rpx;
			image{
				width: 150rpx;
				height: 150rpx;
			}
		}
		.item-text{
			color: #666;
			text-indent: 2em;
		}
		.info-active{
			margin-top: 12rpx;
			background-color: #FFFFFF;
			.honor-item{
				// width: 94%;
				padding: 20rpx 30rpx;
				margin: 0 auto;
				display: flex;
				// margin-top: 20rpx;
				justify-content: space-between;
				border-bottom: 1px solid #DCDFE6;
				.honor-left{
					width: 60%;
					position: relative;
					.honor-image{
						width: 25rpx;
						height: 30rpx;
						position: absolute;
						top: 0;
						left: 10rpx;
					}
					.honor-left-title{
						margin-bottom: 50rpx;
						margin-left: 40rpx;
					}
					.honor-left-place, .honor-left-time{
						font-size: 26rpx;
						color: #999999;
						margin-bottom: 12rpx;
						margin-left: 40rpx;
					}
				}
				.honor-right{
					width: 160rpx;
					height: 130rpx;
					border: 1px solid #999999;
					margin-right: 20rpx;
					margin-top: 20rpx;
					image{
						width: 160rpx;
						height: 130rpx;
					}
				}
			}
		}
		.info-project{
			margin-top: 12rpx;
			background-color: #FFFFFF;
			.honor-item{
				width: 94%;
				padding: 15rpx 0;
				margin: 0 auto;
					position: relative;
					.honor-image{
						width: 30rpx;
						height: 30rpx;
						position: absolute;
						top: 20rpx;
					}
					.honor-left-title{
						margin-bottom: 20rpx;
						margin-left: 40rpx;
					}
					.honor-left-place, .honor-left-time{
						font-size: 26rpx;
						color: #999999;
						margin-bottom: 20rpx;
						margin-left: 40rpx;
					}
			}
		}
	}
</style>
